package com.codemeta.bokit.comm.annotation;

import com.codemeta.bokit.comm.enums.SensitiveStrategy;
import com.codemeta.bokit.comm.serializer.SensitiveJsonSerializer;
import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 自定义jackson脱敏注解，标注在属性上
 *
 * @author hice
 * @date 2021/10/31
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@JacksonAnnotationsInside
@JsonSerialize(using = SensitiveJsonSerializer.class)
public @interface Sensitive {

    // 脱敏策略
    SensitiveStrategy strategy();
}